Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace scanner with reader #3406 #3422

Merged
merged 19 commits into from
Dec 6, 2023

Conversation

fritschldwg
Copy link
Contributor

@fritschldwg fritschldwg commented Nov 30, 2023

Replace scanner with reader #3406

Issue: #3406

Description

  • Fix for a bug in the piped input project checking code
  • Previously relied on a scanner to detect piped input, assuming no bytes meant no project
  • Bug occurred in interactive mode when pressing enter after the last question, causing bytes to be available
  • The scanner entered reading mode and hung indefinitely, waiting for user input
  • Resolved the issue by switching to a reader instead of a scanner
  • The reader provides a method to check whether the next read is blocking or not, preventing the hang bug
  • Also resolves point 5 of issue RawTextParser fails for multiple inputs #3406

Definition of Done

A PR is only ready for merge once all the following acceptance criteria are fulfilled:

  • Changes have been manually tested
  • All TODOs related to this PR have been closed
  • There are automated tests for newly written code and bug fixes
  • All bugs discovered while working on this PR have been submitted as issues (if not already an open issue)
  • Documentation (GH-pages, analysis/visualisation READMEs, parser READMEs, --help, etc.) has been updated (almost always necessary except for bug fixes)
  • CHANGELOG.md has been updated

@fritschldwg fritschldwg force-pushed the fix/3406/fix-rawtextparser-input-handling branch from 5f86e9e to eb8ba52 Compare November 30, 2023 10:24
@fritschldwg fritschldwg force-pushed the fix/3406/fix-rawtextparser-input-handling branch from 3779fa7 to 185563e Compare December 5, 2023 14:27
@phanlezz
Copy link
Collaborator

phanlezz commented Dec 6, 2023

Does this close #2858 ?

Copy link
Collaborator

@phanlezz phanlezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #2858

  • Void -> Unit
  • Test for ProjectInputReader line 93, return streamContent if JSON malformed
  • Sonar code smell interface -> fun interface
  • "{" -> '{'

🚀 lgtm!

@fritschldwg
Copy link
Contributor Author

Closes #2858

  • Void -> Unit
  • Test for ProjectInputReader line 93, return streamContent if JSON malformed
  • Sonar code smell interface -> fun interface
  • "{" -> '{'

🚀 lgtm!

Apparently, functional interfaces can only contain abstract functions. We could convert the PipeableParser to an abstract class, but imo this would inconsistent with the InteractiveParser. For now I am accepting the code smell.

@fritschldwg fritschldwg enabled auto-merge (rebase) December 6, 2023 11:01
Copy link

sonarcloud bot commented Dec 6, 2023

[CodeCharta Visualization] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link

sonarcloud bot commented Dec 6, 2023

[CodeCharta Analysis] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

99.0% 99.0% Coverage
0.0% 0.0% Duplication

@fritschldwg fritschldwg merged commit 2119df6 into main Dec 6, 2023
7 checks passed
@fritschldwg fritschldwg deleted the fix/3406/fix-rawtextparser-input-handling branch December 6, 2023 11:07
@fritschldwg fritschldwg restored the fix/3406/fix-rawtextparser-input-handling branch December 6, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants